﻿using FreeSql.DatabaseModel;using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;

namespace Unis.FMS.Platform.Order.Domain {

	[JsonObject(MemberSerialization.OptIn), Table(Name = "doc_dpt_open_job", DisableSyncStructure = true)]
	public partial class DocDptOpenJob {

		[JsonProperty, Column(Name = "id", DbType = "int", IsPrimary = true, IsIdentity = true)]
		public int Id { get; set; }

		/// <summary>
		/// 实际创建时间,客户端操作实际发生时间,UTC
		/// </summary>
		[JsonProperty, Column(Name = "actual_create_time", DbType = "datetime")]
		public DateTime ActualCreateTime { get; set; } = DateTime.Parse("1970-01-01 00:00:00");

		/// <summary>
		/// 实际更新时间,客户端操作实际发生时间,UTC
		/// </summary>
		[JsonProperty, Column(Name = "actual_update_time", DbType = "datetime")]
		public DateTime ActualUpdateTime { get; set; } = DateTime.Parse("1970-01-01 00:00:00");

		/// <summary>
		/// 预约日期 yyyy-mm-dd 0:00
		/// </summary>
		[JsonProperty, Column(Name = "appointment_date", DbType = "datetime", InsertValueSql = "CURRENT_TIMESTAMP")]
		public DateTime AppointmentDate { get; set; }

		/// <summary>
		/// task appointment id
		/// </summary>
		[JsonProperty, Column(Name = "appointment_id", DbType = "bigint")]
		public long AppointmentId { get; set; } = 0;

		/// <summary>
		/// 预约单号
		/// </summary>
		[JsonProperty, Column(Name = "appointment_no", StringLength = 50, IsNullable = false)]
		public string AppointmentNo { get; set; }

		[JsonProperty, Column(Name = "carrier_code", StringLength = 50, IsNullable = false)]
		public string CarrierCode { get; set; }

		[JsonProperty, Column(Name = "carrier_name", StringLength = 50, IsNullable = false)]
		public string CarrierName { get; set; }

		/// <summary>
		/// carrierType 2:MCA,6:Individual
		/// </summary>
		[JsonProperty, Column(Name = "carrier_type", DbType = "tinyint")]
		public sbyte CarrierType { get; set; } = 0;

		/// <summary>
		/// 创建人
		/// </summary>
		[JsonProperty, Column(Name = "create_user", StringLength = 50, IsNullable = false)]
		public string CreateUser { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		[JsonProperty, Column(Name = "created_by", DbType = "int")]
		public int CreatedBy { get; set; } = 0;

		/// <summary>
		/// 创建时间
		/// </summary>
		[JsonProperty, Column(Name = "created_time", DbType = "datetime", InsertValueSql = "CURRENT_TIMESTAMP")]
		public DateTime CreatedTime { get; set; }

		[JsonProperty, Column(Name = "driver_code", StringLength = 50, IsNullable = false)]
		public string DriverCode { get; set; }

		[JsonProperty, Column(Name = "driver_name", StringLength = 50, IsNullable = false)]
		public string DriverName { get; set; }

		/// <summary>
		/// 报酬
		/// </summary>
		[JsonProperty, Column(Name = "earning")]
		public decimal Earning { get; set; } = 0.00M;

		/// <summary>
		/// 是否删除（0.正常 1.删除）;0.正常 1.删除
		/// </summary>
		[JsonProperty, Column(Name = "is_del", DbType = "tinyint")]
		public sbyte IsDel { get; set; } = 0;

		/// <summary>
		/// 是否主Job，用于多个Task捆绑预约。只展示primary的。
		/// </summary>
		[JsonProperty, Column(Name = "is_primary", DbType = "tinyint")]
		public sbyte IsPrimary { get; set; } = 1;

		/// <summary>
		/// 0:pickup task appointment 
		/// 1:delivery task appointment
		/// 2:service task appointment
		/// 3:trip appointment
		/// </summary>
		[JsonProperty, Column(Name = "job_type", DbType = "tinyint")]
		public sbyte JobType { get; set; }

		/// <summary>
		/// 拒绝原因
		/// </summary>
		[JsonProperty, Column(Name = "reject_reason", StringLength = 500, IsNullable = false)]
		public string RejectReason { get; set; }

		/// <summary>
		/// 1:queue 2:accept 3:assigned 4:rejected 5:closed
		/// 6:dispatched 7.cancel
		/// </summary>
		[JsonProperty, Column(Name = "status", DbType = "tinyint")]
		public sbyte Status { get; set; }

		/// <summary>
		/// task no
		/// </summary>
		[JsonProperty, Column(Name = "task_no", DbType = "bigint")]
		public long TaskNo { get; set; } = 0;

		/// <summary>
		/// 预约开始时间
		/// </summary>
		[JsonProperty, Column(Name = "time_from", DbType = "datetime", InsertValueSql = "CURRENT_TIMESTAMP")]
		public DateTime TimeFrom { get; set; }

		/// <summary>
		/// 预约结束时间
		/// </summary>
		[JsonProperty, Column(Name = "time_to", DbType = "datetime", InsertValueSql = "CURRENT_TIMESTAMP")]
		public DateTime TimeTo { get; set; }

		[JsonProperty, Column(Name = "trip_no", DbType = "bigint")]
		public long TripNo { get; set; }

		/// <summary>
		/// 更新人
		/// </summary>
		[JsonProperty, Column(Name = "update_by", DbType = "int")]
		public int UpdateBy { get; set; } = 0;

		/// <summary>
		/// 更新时间
		/// </summary>
		[JsonProperty, Column(Name = "update_time", DbType = "datetime", InsertValueSql = "CURRENT_TIMESTAMP")]
		public DateTime UpdateTime { get; set; }

		/// <summary>
		/// 修改人
		/// </summary>
		[JsonProperty, Column(Name = "update_user", StringLength = 50, IsNullable = false)]
		public string UpdateUser { get; set; }

	}

}
